﻿Public Class clsFlbMst

    Public Function getAllList(material_code As String) As DataTable
        Dim dt As DataTable = New DataTable
        Dim szSql As String = String.Empty
        szSql &= "SELECT * FROM sf.t_mst_flb "
        szSql &= " WHERE 1 = 1 "
        If material_code.Length > 0 Then
            szSql &= " and material_code = ? "
            dt = DBacs.ExecuteSql(szSql, -1, material_code)
        Else
            dt = DBacs.ExecuteSql(szSql, -1)
        End If
        Return dt
    End Function

    Public Function selectAll(material_code As String) As DataTable
        Dim dt As DataTable = New DataTable
        Dim szSql As String = String.Empty
        szSql &= "SELECT * FROM sf.t_mst_flb "
        szSql &= " WHERE 1 = 1 "
        If material_code.Length > 0 Then
            szSql &= " and material_code = ? "
            dt = DBacs.ExecuteSql(szSql, -1, material_code)
        Else
            dt = DBacs.ExecuteSql(szSql, -1)
        End If
        Return dt
    End Function

    Public Function selectAll() As DataTable
        Dim dt As DataTable = New DataTable
        Dim szSql As String = String.Empty
        szSql &= "SELECT * FROM sf.t_mst_flb "
        szSql &= " WHERE 1 = 1 and cur_num > 0"
        dt = DBacs.ExecuteSql(szSql, -1)
        Return dt
    End Function

    Public Function getAllList() As DataTable
        Dim szSql As String = String.Empty
        szSql &= "SELECT mst_value || ' (' || size  || ')' || ' (' || material_code  || ')'as mst_name,* FROM sf.t_mst_flb "
        szSql &= " WHERE 1 = 1 and validity = ? order by sys_id "
        Return DBacs.ExecuteSql(szSql, -1, "1")
    End Function

End Class
